<%@ page contentType="text/html; charset=utf-8" 
import="com.opensymphony.xwork2.util.*
       ,org.jackysoft.entity.ViewFile,org.jackysoft.util.SpringSecurityUtils"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>	
<title>文档浏览器</title>
<style type="text/css">
*{
font-size:12px;
}
</style>
<script type="text/javascript">

</script>
	</head>
	<body>
<%
			//-------- SOAOFFICE 服务器端编程开始 ------------------------ //
			SOAOfficeX.SOAOfficeCtrl SOACtrl = new SOAOfficeX.SOAOfficeCtrl(
					pageContext);
          
			// 设置SOAOFFICE中间件服务页面
			SOACtrl.ServerURL = "/soaservlet/soaserv.do";

			// 设置界面样式
			SOACtrl.MainStyle = 2;
			SOACtrl.Caption = "您可以修改这里的文字，正式版本的控件不会出现科翰软件的关于对话框";
			SOACtrl.BorderStyle = 0;
			//SOACtrl.Titlebar = false;
			//SOACtrl.TitlebarColor = Color.decode("#FF0000");
			//SOACtrl.TitlebarTextColor = Color.decode("#FFFF00");
			SOACtrl.Menubar = false;
			SOACtrl.Toolbars = false;

			//设置保存文档的服务器页面
			String userlocal = SpringSecurityUtils.getCurrentUserName();
			ValueStack vs=(ValueStack)request.getAttribute("struts.valueStack");   
			ViewFile vf = (ViewFile)vs.findValue("viewFile");
			log("ViewFile is : "+vf);
			String extision = vf.getExtision();
			String pid = "Word.Document";
			if("doc".equalsIgnoreCase(extision))
				pid = "Word.Document";
			else if("xls".equalsIgnoreCase(extision))
				pid = "Excel.Sheet";
			else if("ppt".equalsIgnoreCase(extision) || "pps".equalsIgnoreCase(extision))
				pid = "PowerPoint.Show";
			else
				pid="unkown";
		
			
			//SOACtrl.SaveDocURL = "/stat/blueprint/savedoc?workflowId="+workflowId;
            String openurl = "viewfile/stream?viewFile.id="+vf.getId();
			// 打开文档			
			SOACtrl.webOpen(openurl, 0, userlocal, pid);
			// -------- SOAOFFICE 服务器端编程结束 ------------------------ //
%>
		
<%@ include file="../jsp/soaobject.jsp"%>
</body>
</html>
